package com.huawei.appgallery.forum.message.fragment;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import com.huawei.appgallery.forum.base.ui.JGWTabFragment;
import com.huawei.appgallery.forum.message.api.ILauncherMsgSwitchSettingProtocol;
import com.huawei.appgallery.forum.message.msgsetting.launcher.request.GetLauncherMsgSettingResponse;
import com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment;
import com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment.b;
import com.huawei.appgallery.serverreqkit.api.bean.ResponseBean;
import com.huawei.hmf.annotation.FragmentDefine;
import java.util.List;
import o.bsl;
import o.bvj.f;
import o.bwf;
import o.bwh;

@FragmentDefine(alias = "msg_setting_fragment", protocol = ILauncherMsgSwitchSettingProtocol.class)
public class LauncherMsgSwitchSettingFragment extends JGWTabFragment {
    public void ॱ(Activity activity) {
        super.ॱ(activity);
    }

    public void ˏ(Bundle bundle) {
        this.ʼ = new bsl(this, null, this.ʼˊ);
        super.ˏ(bundle);
    }

    public void ˋ(TaskFragment taskFragment, List list) {
        list.add(new bwh());
    }

    public boolean ˊ(TaskFragment taskFragment, b bVar) {
        if ((bVar.ˊ instanceof bwh) && (bVar.ˋ instanceof GetLauncherMsgSettingResponse)) {
            GetLauncherMsgSettingResponse getLauncherMsgSettingResponse = (GetLauncherMsgSettingResponse) bVar.ˋ;
            if (getLauncherMsgSettingResponse.getRtnCode_() == 0 && getLauncherMsgSettingResponse.getResponseCode() == 0) {
                ˋ(getLauncherMsgSettingResponse);
            } else {
                ˎ(getLauncherMsgSettingResponse);
            }
        }
        return false;
    }

    private void ˎ(GetLauncherMsgSettingResponse getLauncherMsgSettingResponse) {
        ˊॱ(true);
        int ˎ = ˎ((ResponseBean) getLauncherMsgSettingResponse);
        if (this.ॱˌ != null) {
            this.ॱˌ.onEvent(ˎ);
        } else {
            ˊ(ˎ, this.ՙ);
        }
    }

    private void ˋ(GetLauncherMsgSettingResponse getLauncherMsgSettingResponse) {
        ॱˋ(true);
        ˋॱ(true);
        ॱˎ(0);
        Context ॱˋ = ॱˋ();
        if (ॱˋ != null && this.י != null) {
            new bwf(getLauncherMsgSettingResponse).ˊ(ॱˋ, this.י, f.ˎ);
            this.י.ˊ(false);
        }
    }
}
